var dataView;

function initDataView(subItemList) {
	boardLayout.attachHTMLString('<div id="viewDiv"></div>');
	
	dataView = new dhtmlXDataView({
			container : 'viewDiv'
			,height : 'auto'});
	dataView.attachEvent('onItemDblClick', function(id, ev, html){
	    topologyTree.selectItem(id);
	    topologyTree.openItem(id);
	    setTitleAndCallBoard(id);
	    
	    if ( topologyTree.hasChildren(id) > 0 ) {
	    	addViewItems(topologyTree.getSubItems(id));
	    }
	    
	    return true;
	});
	dataView.define('type', 'ficons');
	dataView.customize({
		icons_src_dir : IMAGE_PATH + '/custom_imgs/'
	});

	addViewItems(subItemList);
}

function addViewItems(subItemList) {
	// viewItem clear
	dataView.clearAll();
	
	var subItemArray = subItemList.split(',');
	
	for ( var i = 0; i < subItemArray.length; i++ ) {
		var itemText 	= topologyTree.getItemText(subItemArray[i]);
		var postfix		= '';
		
		if ( subItemArray[i].split('-').length == 3 ) {
			postfix = '.file';
		}
		
		dataView.add({
			id : subItemArray[i]
			,name : itemText + postfix
		});
	}
}